#include <iostream>
#include <vector>
using namespace std;
struct DSU{
    vector<int> parent, size;
    DSU(int n) {
        parent.resize(n + 1);
        size.resize(n + 1, 1);
        for(int i = 0; i <= n; i++) {
            parent[i] = i;
        }
    }
    int find(int x) {
        if(parent[x] != x) {
            parent[x] = find(parent[x]);
        }
        return parent[x];
    }
    void unite(int x, int y) {
        int fx = find(x), fy = find(y);
        if(fx == fy) {
            return;
        }
        if(size[fx] < size[fy]) {
            swap(fx, fy);
        }
        parent[fy] = fx;
        size[fx] += size[fy]; 
    }
    bool same(int x, int y) {
        return find(x) == find(y);
    }
};
int main() {
    int n, m, p;
    cin >> n >> m >> p;
    DSU a(n + 1);
    for(int i = 0; i < m; i++) {
        int x, y;
        cin >> x >> y;
        a.unite(x, y);
    }
    for(int i = 0; i < p; i++) {
        int x, y;
        cin >> x >> y;
        if(a.same(x, y)) {
            cout << "Yes" << endl;
        }else {
            cout << "No" << endl;
        }
    }
    return 0;
}